package icu.xuyijie.springbootlearning2.chapter1_2.controller;

import icu.xuyijie.springbootlearning2.chapter1_2.config.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 徐一杰
 * @date 2025/2/20 14:14
 * @description
 */
@RestController
@RequestMapping("/test2")
public class TestController2 {

    @Autowired
    private Student student;

    //@Value("${my.config.name}")
    private String name;

    @Value("#{1+2}")
    private Integer age;

    @Value("sadasdasdas")
    private String str;

    @GetMapping("/a")
    public void helloWorld() {
        System.out.println(student);
    }

    @GetMapping("/b")
    public void b() {
        System.out.println(name);
        System.out.println(age);
        System.out.println(str);
    }

}
